package gitlab

import (
	"project-info/src/handle/gitlab"
	"project-info/src/router/req"
	"project-info/src/router/variable"

	"github.com/gin-gonic/gin"
)

func init() {
	variable.InitRouteFunc = append(variable.InitRouteFunc, InitGitlabRoutes)
}

func InitGitlabRoutes(e *gin.Engine) {
	gitlabGroup := req.NewGroup("/gitlab").NeedToken().SetUpGroup(e)
	reqs := []*req.Conf{
		req.NewGet("/syncRepos", gitlab.SyncGitlabRepos),
		req.NewPost("/searchRepos", gitlab.SearchGitlabRepos),
	}
	req.BatchSetUpRouter(gitlabGroup, reqs)
}
